<!-- 自定义页面 -->
<template>
	<view class="card">
		<view class="dl">
			<view class="dt">防&ensp;伪&ensp;码：</view>
			<view class="dd">{{ resultData.security_code }}</view>
		</view>
		<view class="dl">
			<view class="dt">查询结果：</view>
			<view class="dd">
				<text class="text-green" v-if="resultData.result  === 1">官方正品</text>
				<text class="text-red" v-else>查无此码</text>
			</view>
		</view>
		<view class="dl">
			<view class="dt">产品类别：</view>
			<view class="dd">{{ resultData.category }}</view>
		</view>
		<view class="dl">
			<view class="dt">产品名称：</view>
			<view class="dd">{{ resultData.prodName }}</view>
		</view>
		<view class="dl">
			<view class="dt">规格型号：</view>
			<view class="dd">{{ resultData.parameter }}</view>
		</view>
		<view class="dl">
			<view class="dt">出库时间：</view>
			<view class="dd">{{ resultData.deliveryTime }}</view>
		</view>
		<view class="dl">
			<view class="dt">备&emsp;&emsp;注：</view>
			<view class="dd">{{ resultData.notes }}</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {

		},
		data() {
			return {
				resultData: []
			};
		},

		onShow() {
			this.getDetails();
		},
		onHide() {},
		onLoad() {},
		methods: {
			getDetails() {
				const that = this;
				that.$http(
					'scan.details',
					'获取查询结果中...'
				).then(res => {
					if (res.code === 1) {
						that.resultData = res.data;
					}
					that.$u.toast(res.msg);
				});
			}
		}
	};
</script>

<style lang="scss">
	.dl {
		font-size: 28rpx;

		&:not(:last-child) {
			margin-bottom: 30rpx;
		}

		.dt {
			display: inline-block;
			color: rgba(33, 32, 30, .6);
		}

		.dd {
			display: inline-block;
			color: #21201E;
		}
	}
</style>